package src;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

import java.time.Duration;

public class VideoTest {
    public static void main(String[] args) {
        System.setProperty("webdriver.chrome.driver", "drivers/chromedriver.exe");

        WebDriver driver = new ChromeDriver();
        driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
        driver.manage().window().maximize();

        try {
            LoginTest loginWorkflow = new LoginTest(driver);
            VideoSearchTest videoSearchWorkflow = new VideoSearchTest(driver);
            VideoWatchTest videoClickAndWatchWorkflow = new VideoWatchTest(driver);

            // Test Case 1: Login Test
            loginWorkflow.testLogin();

            // Test Case 2: Video Search Test
            videoSearchWorkflow.testSearch();

            // Test Case 3: Video Watch Test
            videoClickAndWatchWorkflow.testWatch();

        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            driver.quit();
        }
    }
}
